import java.util.Arrays;
public class Question3 {
    public static void main(String[] args) {

        //6个红球
        int reds[] = new int[6];
        //取6次随机数
        for (int i = 0; i < reds.length - 1; i++) {
            //范围1-33
            int index = (int) (Math.random() * 32 + 1);
            reds[i] = index;
            //检验重复
            for (int j = 0; j < i; j++) {
                if (reds[i] == reds[j]) {
                    //已生成随机数计数-1
                    i--;
                    break;
                }
            }
        }
        System.out.println("生成的红球号码为："+Arrays.toString(reds));
        //蓝球
        int blue= (int) (Math.random() * 15 + 1);
        System.out.println("生成的蓝球号码为："+blue);
    }
}
